import React, { useState } from "react";

import Step1 from "./Step1";
import Step2 from "./Step2";

const App = ({ setDetail }) => {
  const [step, setStep] = useState(1);
  const stepRender = () => {
    if (step === 1) {
      return (
        <>
          <Step1 setDetail={setDetail} setStep={setStep} />
        </>
      );
    } else if (step === 2) {
      return (
        <div>
          <Step2 setStep={setStep} setDetail={setDetail} />
        </div>
      );
    }
  };

  return <>{stepRender()}</>;
};

export default App;
